package javaweek6;

import java.util.Scanner;

class ArrayUtils{
	public static class PairResult{
		private double min;
		private double max;
		public PairResult(double min2, double max2) {
			this.min = min2;
			this.max = max2;
		}
		public double getMin() {
			return min;
		}
		public void setMin(double min) {
			this.min = min;
		}
		public double getMax() {
			return max;
		}
		public void setMax(double max) {
			this.max = max;
		}
		@Override
		public String toString() {
			return "PairResult [min=" + min + ", max=" + max + "]";
		}
	}
	
	public static PairResult findMinMax(double[] values){
		double min = values[0];
		double max = values[0];//= Double.MIN_VALUE;
		for (double d : values) {
			if (min > d) min = d;
			if (max < d) max = d;
		}
		return new PairResult(min,max);
	}
}

public class staticinner {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc=new Scanner (System.in);
		int n=sc.nextInt();
		double[] doub=new double[n];
		for (int i = 0; i < n; i++) {
			doub[i]=sc.nextDouble();
		}
		ArrayUtils.PairResult p=ArrayUtils.findMinMax(doub);
		System.out.println(p);
		System.out.println(ArrayUtils.PairResult.class);
		sc.close();
	}

}
